There are four new functions you can use to enhance movie playback.
The SetTrackLoadSettings function allows you to specify a portion of a track that is to be loaded into memory whenever it is played.
pascal void SetTrackLoadSettings (
Track theTrack,
TimeValue preloadTime,
TimeValue preloadDuration,
long preloadFlags,
long defaultHints);
The SetTrackLoadSettings allows you to control how the toolbox preloads the tracks in your movie. By using these settings, you make this information part of the movie, so that the preloading takes place every time the movie is opened, without an application having to call the LoadTrackIntoRAM function. Consequently, you should use this feature carefully, so that your movies do not consume large amounts of memory when opened.
The toolbox transfers this preload information when you call the CopyTrackSettings function. In addition, the preload information is preserved when you save or flatten a movie (using either the FlattenMovie or FlattenMovieData functions). In flattened movies, the tracks that are to be preloaded are stored at the start of the movie, rather than being interleaved with the rest of the movie data. This improves preload performance.
The GetTrackLoadSettings function allows you to retrieve a track's preload information.
pascal void GetTrackLoadSettings (
Track theTrack,
TimeValue *preloadTime,
TimeValue *preloadDuration,
long *preloadFlags,
long *defaultHints);
The GetTrackDisplayMatrix function returns a matrix that is the concatenation of all matrices currently effecting the track's location, scaling, and so on. This includes the movie's matrix, the track's matrix, and the modifier matrix. Since modifier information is passed between tracks at MoviesTask time, the information returned by this call represents the matrix in effect at the last MoviesTask call.
pascal OSErr GetTrackDisplayMatrix(
Track theTrack,
MatrixRecord *matrix );
Note
To determine the entire clip of a track at the current time using
GetTrackDisplayBoundsRgn
. The results of
GetTrackDisplayBoundsRgn
take into account any clip regions provided by modifier tracks.
Sets up any necessary network connections to receive streaming content. Beginning with QuickTime 4, your application should call PrePrerollMovie any time it calls PrerollMovie.
OSErr PrePrerollMovie(
Movie m
TimeValue time
Fixed rate
MoviePrePrerollCompleteUPP proc
void *refcon );
Before a movie is played, it is normally prerolled. During preroll, the Movie Toolbox tells the appropriate media handlers to load the movie data, allocate sound channels, start up image-decompression sequences, and so on.
Before a movie that contains streaming content is prerolled, it must be pre-prerolled. This sets up any necessary network connections between the client and the server.
If a movie contains streaming content (one or more 'strm' tracks), you must call PrePrerollMovie before calling PrerollMovie. If the movie does not contain streaming content, calling PrePrerollMovie has no effect. If your application calls the PrerollMovie function, it should always call the PrePrerollMovie function first.
If you play movies using a movie controller, you do not need to preroll or pre-preroll the movie explicitly; it is done for you automatically.
If a completion proc is specified in the MoviePrePrerollCompleteUPP parameter, PrePrerollMovie is asynchronous; it returns almost immediately and calls the completion proc when pre-prerolling is complete. If no completion proc is specified, PrePrerollMovie operates synchronously and the function will not return until pre-prerolling is complete. This can take a long time, particularly if a dial-up network connection must be established.
invalidMovie | -2010 | This movie is corrupted or invalid |
invalidTime | -2015 | This time value is invalid |
network errors |
| Previous | Chapter Contents | Chapter Top | Next |